package day05;

import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int score=0;
        for (int i=1;i<=10;i++){
            int num1 = (int) (Math.random()*100);
            int num2 = (int) (Math.random()*100);
            System.out.println("("+i+")"+num1+"+"+num2+"=？");

            int num=num1+num2;
            int age = scan.nextInt();

            if (age==num){
                System.out.println("答对了");
                score+=10;
            }else {
                System.out.println("答错了");
            }
        }
        System.out.println("总分为："+score);
    }
}
